 <meta charset="utf-8">
 <div class="card card-primary" id="app_AlgorithmConfigItem_edit" style="max-width: 1200px;" > 
 
     <form role="form"  id="editForm" >
            <div class="card-body"> 
			    
					<div class="form-group" >
	                  <label for="name" class="control-label">配置编码</label>
	                  <input type="text" v-model="algorithmConfigItem.code" class="form-control"  required="required"/>
	                </div>
					
					<div class="form-group" >
	                  <label for="name" class="control-label">配置名称</label>
	                  <input type="text" v-model="algorithmConfigItem.name" class="form-control"  required="required"/>
	                </div>
					
					<div class="form-group" >
	                  <label for="name" class="control-label">数据类型</label>
	                  <select v-model="algorithmConfigItem.dataType"  class="form-control"  required="required">
		                  <option value="1">文本</option>
		                  <option value="2">整数</option>
		                  <option value="3">浮点数</option>
		                  <option value="4">布尔型</option>
	                  </select>
	                </div>
					
					<div class="form-group" >
	                  <label for="name" class="control-label">配置模式</label>
	                  <select v-model="algorithmConfigItem.configMode"  class="form-control"  required="required">
		                  <option value="1">文本填入</option>
		                  <option value="2">视频画线配置</option>
	                  </select>
	                </div>
	                
	                	<div class="form-group" >
	                  <label for="name" class="control-label">值</label>
	                  <input type="text" v-model="confvalue" class="form-control"  required="required"/>
	                </div>
             
            </div>
            <div class="form-group" style="padding-right: 15px;padding-left: 15px;">
                 <button type="button" class="btn btn-light" v-on:click="cancel">取消</button>
                 <button type="button" class="btn btn-info float-right"  v-on:click="edit">提交</button>
              </div> 
       </form>

<script type="text/javascript">
var news= new Vue({
    el: '#app_AlgorithmConfigItem_edit',
    data: {
    	confvalue: null,
    	param:{},
    	configValue:{},
    	algorithmConfigItem:{},
    	
    	solutionId: null,
    	configItemValueId: null,
    	algorithmId: null,
    	deviceId: null,
    	groupId: null,
    	
    	bus:new Vue()
    	
    //	var param={itemId: configItemValueId,algorithmId: _this.nowAlgorithm.id,deviceId: _this.deviceId,solutionId: _this.nowSolution.id};
     },
     mounted:function(){
    	 var _this=this;
    	 var param=zfesLayerEditDg.getLayerParam();
    	 
    	 _this.solutionId=param.solutionId;
    	 _this.algorithmId=param.algorithmId;
    	 _this.configItemValueId=param.itemId;
    	 
    	 _this.deviceId=param.deviceId;
    	 _this.groupId=param.groupId;
    	 
    	 console.log("_this.solutionId:"+_this.solutionId+"||_this.algorithmId:"+_this.algorithmId+"||_this.configItemValueId:"+_this.configItemValueId+"||_this.deviceId"+_this.deviceId+"||_this.groupId:"+_this.groupId);
    	 
    	 _this.initData();
     },
     methods: {
     	initData: function(){
    		 var _this=this;
    		  var param=zfesLayerEditDg.getLayerParam();
    		  _this.param=param;
    		 var url="/manager/solution/config/loadConfigValue";
    		 zfesAjax.ajaxTodo(url,param, function(data){
        		 _this.algorithmConfigItem=data.data.configItem;
        		 if(data.data.configValue){
        			 _this.configValue=data.data.configValue;
        			 _this.confvalue=_this.configValue.cofvalue;
        		 }
        	 });
 		},
    	 edit: function () {
    	    	if($("#editForm").valid()){
    	    		var _this=this;
    	    		var url="/manager/solution/config/updateConfigValue";
    	    		zfesAjax.ajaxJson(url,$.extend( _this.param, {cofvalue:_this.confvalue} ), function(data){
    	    			alertSwal.successText(data.message);
    	        		 layer.close(layer.index);
    	        	 })
    	    		
    	    	}
    	    },
    	    cancel: function(){
    	    	 layer.close(layer.index);
    	    }
    }
});
</script>
</div>